#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
#include<QResizeEvent>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QRect windowRect = this->geometry();
    ui->label->setGeometry(0,0,windowRect.width(),windowRect.height());
  //  ui->label->setGeometry(0,0,800,600);  硬编码
    QPixmap pixmap(":/666.png");
    ui->label->setPixmap(pixmap);

}
Widget::~Widget()
{
    delete ui;
}

void Widget::resizeEvent(QResizeEvent*event)
{
    qDebug()<<event->size();
    ui->label->setGeometry(0,0,event->size().width(),event->size().height());
}
